<template>
	<view>
		<view class="searchbox">
			<view class="search-input">
				<icon type="search" :size="15" color="#555"></icon>
				<input confirm-type="search" placeholder="请输入名称" :focus="true" auto-focus placeholder-class="input-plholder" class="input" v-model.trim="key" />
				<icon type="clear" :size="15" color="#888" @tap="cleanKey" v-show="key"></icon>
			</view>
			<view class="cancle" @tap="back">取消</view>
		</view>
		<view class="chapter-list">
			<view class="item" v-for="(v,k) in beforeList" :key="k" @click.stop="toBookDetail(k,v)">
				<view class="chapter-title">
					{{v.title}}
					<view class="sub-title">
						试题60道，总分100分，及格60分，考试时间120分钟
					</view>
				</view>
				<view class="read-vip">
					<view style="text-align: center;">{{v.isFree?'考试':'专享'}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {
			
		},
		data() {
			return {
				scrollTop: 0,
				scrollH: 0, 
				userInfo:"",
				beforeList: [{
						title: '2000年《高等数学》真题试卷',
						use: 10,
						sum: 100,
						rightPer: 65,
						isFree: 1
					},
					{
						title: '第二章 高等数学',
						use: 0,
						sum: 100,
						rightPer: 0,
						isFree: 0
					},
					{
						title: '第三章 高等物理',
						use: 0,
						sum: 100,
						rightPer: 0,
						isFree: 0
					}
				],
				book: {},
				sumPage: 0,
				page: 1,
				limit: 10,
			};
		},
		methods:{
			cleanKey() {
				this.key = '';
			}
		}
		}
</script>

<style lang="scss">
	.searchbox {
		padding: 30rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		position: fixed;
		left: 0;
		// #ifdef H5
		top: 88rpx; 
		// #endif
		// #ifdef MP-WEIXIN
		top: 0; 
		// #endif
		width: 100%;
		background: $themeColor;
		z-index: 99999999;
	}
	
	.search-input {
		width: 100%;
		height: 66rpx;
		border-radius: 35rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		background: #f2f2f2;
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
	}
	.search-input icon{
		font-size: 24rpx;
	}
	.input {
		flex: 1;
		color: #333;
		padding: 0 16rpx;
		font-size: 28rpx;
	}
	
	.input-plholder {
		font-size: 28rpx;
		color: #b2b2b2;
	}
	
	.cancle {
		color: #fff;
		font-size: 28rpx;
		padding-left: 30rpx;
		flex-shrink: 0;
	}
	.chapter-list {
		margin: 25rpx 25rpx 50rpx 25rpx;
	
		.title {
			color: #333;
			font-size: 30rpx;
			margin-bottom: 40rpx;
	
			text {
				margin-left: 25rpx;
				color: #555;
				font-weight: normal;
				font-size: 30rpx
			}
		}
	
		.item {
			display: flex;
			justify-content: space-between;
			padding: 25rpx 0;
			border-bottom: 1rpx #cfcfcf solid;
	
			.chapter-title {
				font-size: 30rpx;
				width: 85%;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
	
				.sub-title {
					font-size: 25rpx;
					color: #666;
				}
			}
	
			.read-vip {
				font-size: 28rpx;
				color: $themeColor;
			}
		}
	}
</style>